#include <stdio.h>
    int main()
    {
    int sum = 0;
    int size = 0;
    scanf("%d", &size);
    int arr[size];
    for(int i = 0; i < size; i++)
    {
        scanf("%d", &arr[i]);
    }
	for (int start = 0; start < size; start++)
	{
		    for (int length = 0; length < size; length += 2)
		{
			int end = start + length;
			for (int index = start; index <= end && end < size; index++)
			{
				sum += arr[index];
			}
		}
	}
    return sum;
    }